package com.yxt.qmgf.common.view;

import com.yxt.qmgf.common.IPubCost;
import com.yxt.qmgf.common.ImageSrc;
import javafx.scene.Node;
import javafx.scene.control.Alert;
import javafx.scene.image.Image;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;

public class CdzAlert extends Alert {
    public CdzAlert(AlertType alertType) {
        super(alertType);
        init();
    }

    public CdzAlert(AlertType alertType, String message) {
        super(alertType, message);
        init();
    }

    public CdzAlert(AlertType alertType, Node node) {
        super(alertType);
        this.getDialogPane().setContent(node);
        init();
    }

    private void init() {
        setHeaderText(null);
        Pane pane = getDialogPane();
        Stage stage = (Stage) pane.getScene().getWindow();
        stage.getIcons().add(new Image(ImageSrc.lOGO_PATH));
        pane.getStylesheets().add(IPubCost.CSSPATH);
    }
}
